/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author bbaquero
 */
@Entity
@Table(name = "cancion")
@NamedQueries({@NamedQuery(name = "Cancion.findAll", query = "SELECT c FROM Cancion c"), @NamedQuery(name = "Cancion.findByIdCancion", query = "SELECT c FROM Cancion c WHERE c.idCancion = :idCancion"), @NamedQuery(name = "Cancion.findByIdAlbum", query = "SELECT c FROM Cancion c WHERE c.idAlbum = :idAlbum"), @NamedQuery(name = "Cancion.findByCancion", query = "SELECT c FROM Cancion c WHERE c.cancion = :cancion"), @NamedQuery(name = "Cancion.findByAutor", query = "SELECT c FROM Cancion c WHERE c.autor = :autor"), @NamedQuery(name = "Cancion.findByNumero", query = "SELECT c FROM Cancion c WHERE c.numero = :numero")})
public class Cancion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_cancion")
    private Integer idCancion;
    @Column(name = "id_album")
    private Integer idAlbum;
    @Column(name = "cancion")
    private String cancion;
    @Lob
    @Column(name = "letra")
    private String letra;
    @Column(name = "autor")
    private String autor;
    @Column(name = "numero")
    private String numero;

    public Cancion() {
    }

    public Cancion(Integer idCancion) {
        this.idCancion = idCancion;
    }

    public Integer getIdCancion() {
        return idCancion;
    }

    public void setIdCancion(Integer idCancion) {
        this.idCancion = idCancion;
    }

    public Integer getIdAlbum() {
        return idAlbum;
    }

    public void setIdAlbum(Integer idAlbum) {
        this.idAlbum = idAlbum;
    }

    public String getCancion() {
        return cancion;
    }

    public void setCancion(String cancion) {
        this.cancion = cancion;
    }

    public String getLetra() {
        return letra;
    }

    public void setLetra(String letra) {
        this.letra = letra;
    }

    public String getAutor() {
        return autor;
    }

    public void setAutor(String autor) {
        this.autor = autor;
    }

    public String getNumero() {
        return numero;
    }

    public void setNumero(String numero) {
        this.numero = numero;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCancion != null ? idCancion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cancion)) {
            return false;
        }
        Cancion other = (Cancion) object;
        if ((this.idCancion == null && other.idCancion != null) || (this.idCancion != null && !this.idCancion.equals(other.idCancion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Cancion[idCancion=" + idCancion + "]";
    }

}
